function ret=distance2(vect1,vect2)
 x1=vectorLength(vect1);
 x2=vectorLength(vect2);
 if(x1*x2==0)
  ret=4*sin(max(x1.x2)/4);
  ret=real(ret);
  return;
 endif
 v1=vect1/vectorLength(x1);
 v2=vect2/vectorLength(x2);
 ret=2*sqrt(2)*sqrt(1-cos(x1/2)*cos(x2/2)-sin(x1/2)*sin(x2/2)*(v1*v2'));
 ret=real(ret);
endfunction
